<template>
    <div>
        <Login v-if="!userinfo"></Login>
        <My v-if="userinfo"></My> 
        <TabBar></TabBar>
    </div>
</template>

<script>
import TabBar from '@/components/TabBar.vue'
import Login from '@/components/Login.vue'
import My from '@/components/My.vue'
import {mapState} from 'vuex'
export default {
    computed:{
        ...mapState([
            "userinfo"
        ])
    },
    components:{
        TabBar,
        Login,
        My
    },
    mounted: function () {
        this.$store.dispatch("requestIslogin")
        .then(res => {
            this.$store.commit("setUserinfo",res.data.userinfo);
            
        });

    },
}
</script>

<style scoped>

</style>